#ifndef FIT_METHODS_UTILITY_H
#define FIT_METHODS_UTILITY_H

#include "TH1F.h"
#include "RooRealVar.h"
#include "RooPolynomial.h"
#include "RooArgSet.h"
#include "TPaveText.h"

namespace Utility {
    void subtrBgdFromData(const TH1D *a, const TH1D *b, RooRealVar &nbgd, RooRealVar &nsig, int isol_th);
    void calcCountBelowIsolTh(const TH1D *a, const TH1D *b, RooRealVar &nbgd, RooRealVar &nsig, int isol_th);

    /*******************************************************************************
      Calculate integral from histogram h above/below cut and store in RooRealVar
     *******************************************************************************/
    void calculateIntegral(RooRealVar &var, const TH1D* h, int cut, bool below);

    /*******************************************************************************
      Correct integral to range above/below cut and store in RooRealVar
     *******************************************************************************/
    void correctToRange(RooRealVar &var, TH1D* h, int cut, bool below);
}

#endif
